//导入mongoose
const mongoose=require('./connect')


// /商品表的schema
const dishSchema=new mongoose.Schema({
    //商品名字
    name: {
        //必填
        required: true,
        type: String
    },
    //商品价格
    price: {
        required: true,
        type: Number
    },
    //图片路径
    imgpath: {
        required: true,
        type: String
    },
    //规格
    specifications: String,
    //种类
    kind: String,
    //商品是否上架
    enable: Boolean,
    catname: String
})


const dishModel=mongoose.model('dish',dishSchema,'dish')


module.exports=dishModel
